package com.api.tournament.dao;

import com.api.common.mybatis.ResultMap;
import com.api.core.ApiMapper;
import com.api.tournament.model.TournamentTeam;
import com.api.tournament.vo.TournamentUserVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface TournamentTeamMapper extends ApiMapper<TournamentTeam> {

    /**
     *
     * @param tournamentId
     * @param isCheckIn 是否包含未签到的 true 是包含未签到的
     * @return
     */
    List<TournamentTeam> selectByTeamId(Long teamId, Long tournamentId, boolean isCheckIn);

    List<TournamentUserVo> selectByTournamentId(Long id, Integer tournamentType, boolean isCheckIn);

    /**
     *
     * @param tournamentId
     * @param isCheckIn 是否包含未签到的
     * @return
     */
    List<TournamentTeam> findByTournamentId(Long tournamentId, boolean isCheckIn);

    Integer lastLose(Long tournamentId);

    Integer maxTeam(Long tournamentId);

    List<TournamentUserVo> selectByTournamentIdJoinUser(Long id, boolean isCheckIn);

    List<ResultMap<String, Object>> selectUserByTournamentId(Long tournamentId, boolean isCheckIn);

    TournamentTeam selectOneByTeamId(Long teamId, Long tournamentId, boolean isCheckIn);

    TournamentTeam selectTeamLeader(Long tournamentId, Long userId);

    TournamentTeam selectUserId(Long tournamentId, Long userId);
}